<template>
	<view class="box">

		<view class="mains">
			<view class="tit">
				补贴信息
			</view>
			<view class="item">
				<text class="left">初始More值值</text>
				<view class="right">
					<text >{{info.score}}</text>
				</view>
			</view>
			<view class="item" @click="gonext" >
				<text class="left">More值来源</text>
				<view class="right">
					<text >{{info.score_from_text}}</text>
					<image :src="baseUrl + '/static/icon/right.png'" mode="aspectFill"></image>
				</view>
			</view>
			<view class="item">
				<text class="left">补贴状态</text>
				<text class="right">{{info.status_text}}</text>
			</view>
			<view class="item">
				<text class="left">补贴期数</text>
				<text class="right">{{info.released_round}}期</text>
			</view>
			<view class="item">
				<text class="left">补贴劵额</text>
				<text class="right">{{info.deduction_amount}}</text>
			</view>
			<view class="item">
				<text class="left">剩余More值</text>
				<text class="right">{{info.surplus_score}}</text>
			</view>
		</view>
		<view class="main">
			<view class="tit">
				补贴明细
			</view>
			<view class="wraplist" v-for="item in info.records" :key="item.id" >
				<view class="itemtop">
				<text>{{item.round_text}}</text>
				<view class="itemtopright">
						<text>more劵</text>
						<text class="text1">{{item.amount}}</text>
				</view>
				</view>
				<view class="itembot">
				<text>{{item.create_time}}</text>
				<view class="itemtopright">
						<text>More值</text>
						<text class="text2">{{item.score}}</text>
				</view>
				</view>
			</view>
		</view>
	</view>

</template>

<script>
	import {
		detail
	} from "../../api/other.js"
	export default {
		data() {
			return {
				baseUrl: this.$imageBaseUrl,
				id:"",
				info:{}
			}
		},
		onLoad(e) {
			this.id=e.id
			this.getdetail()
		},
		methods: {
			getdetail(){
				detail({
					id:this.id
				}).then(res=>{
					this.info=res.data
				})
			},
			gonext(){
				uni.navigateTo({
					url:"/pageUser/myuser/saleorderlist?id="+this.id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 750rpx;
		height: 100vh;
		background: #F7F7F7;
	}

	.mains {
		width: 690rpx;
		min-height: 292rpx;
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		margin: 0 auto;
		margin-top: 30rpx;
		padding-bottom: 20rpx;

		.tit {
			width: 630rpx;
			border-bottom: 2rpx solid rgba(0, 0, 0, 0.05);
			padding-top: 30rpx;
			margin: 0 auto;
			padding-bottom: 32rpx;
		}
	}

	.item {
		width: 630rpx;
		display: flex;
		justify-content: space-between;
		margin: 0 auto;
		margin-top: 26rpx;

		.left {
			font-weight: 400;
			font-size: 28rpx;
			color: #666666;
		}

		.right {
			>image{
				width: 14rpx;
				height: 20rpx;
				margin-left: 10rpx;
			}
			font-weight: 400;
			font-size: 28rpx;
			color: #333333;
		}
	}

	.main {
		width: 690rpx;
		min-height: 1042rpx;
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		margin: 0 auto;
		margin-top: 30rpx;

		.tit {
			padding-top: 30rpx;
			margin-left: 30rpx;
			padding-bottom: 30rpx;
			border-bottom: 2rpx solid rgba(0, 0, 0, 0.05);
		}
		.wraplist{
			width: 630rpx;
			margin: 0 auto;
			height: 132rpx;
			border-bottom: 2rpx solid rgba(0,0,0,0.05);
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			.itemtop{
				display: flex;
				justify-content: space-between;
			}
			.itembot{
				display: flex;
				justify-content: space-between;
				>text{
					font-weight: 400;
					font-size: 28rpx;
					color: #999999;
				}
			}
		}

	}

	.text1 {
		font-weight: 700;
		font-size: 30rpx;
		color: #66B250;
		margin-left: 20rpx;
	}

	.text2 {
		font-weight: 700;
		font-size: 30rpx;
		color: #F63418;
		margin-left: 20rpx;
	}
	
</style>